<template>
    <div>
        <el-card class="!border-none mb-4" shadow="never">
            <el-form
                :model="queryParams"
                class="mb-[-16px]"
                inline
            >
                <el-form-item label="名字" prop="name">
                    <el-input v-model="queryParams.name" class="w-[280px]" clearable placeholder="请输入名字" />
                </el-form-item>
                <el-form-item label="客服手机号" prop="customer_service_mobile">
                    <el-input v-model="queryParams.customer_service_mobile" class="w-[280px]" clearable
                              placeholder="请输入客服手机号" />
                </el-form-item>
                <el-form-item label="客服微信号" prop="customer_service_wechat">
                    <el-input v-model="queryParams.customer_service_wechat" class="w-[280px]" clearable
                              placeholder="请输入客服微信号" />
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="resetPage">查询</el-button>
                    <el-button @click="resetParams">重置</el-button>
                </el-form-item>
            </el-form>
        </el-card>
        <el-card v-loading="pager.loading" class="!border-none" shadow="never">
            <div class="mt-4">
                <el-table :data="pager.lists">
                    <el-table-column label="名字" prop="name" show-overflow-tooltip />
                    <el-table-column label="备注" prop="remark" show-overflow-tooltip />
                    <el-table-column label="地址" prop="address" show-overflow-tooltip width="600" />
                    <el-table-column label="地址经度" prop="lon" show-overflow-tooltip />
                    <el-table-column label="地址纬度" prop="lat" show-overflow-tooltip />
                    <el-table-column label="客服手机号" prop="customer_service_mobile" show-overflow-tooltip />
                    <el-table-column label="客服微信号" prop="customer_service_wechat" show-overflow-tooltip />
                </el-table>
            </div>
            <div class="flex mt-4 justify-end">
                <pagination v-model="pager" @change="getLists" />
            </div>
        </el-card>
    </div>
</template>

<script lang="ts" name="boomPlaceLists" setup>
import { usePaging } from '@/hooks/usePaging'
import { apiBoomPlaceLists } from '@/api/boom_place'


// 查询条件
const queryParams = reactive({
    agent_id: '',
    name: '',
    remark: '',
    address: '',
    lon: '',
    lat: '',
    customer_service_mobile: '',
    customer_service_wechat: ''
})


// 分页相关
const { pager, getLists, resetParams, resetPage } = usePaging({
    fetchFun: apiBoomPlaceLists,
    params: queryParams
})


getLists()
</script>

